package rabbit.flt.plugins.spring.r2dbc.matcher;

import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;
import rabbit.flt.plugins.common.matcher.SupportMatcher;

import static net.bytebuddy.matcher.ElementMatchers.named;

/**
 * DefaultDatabaseClient$DefaultGenericExecuteSpec 类增强 1.2+
 */
public class ExecuteSpecSupportMatcher implements SupportMatcher {

    @Override
    public ElementMatcher.Junction<TypeDescription> classMatcher() {
        return named("org.springframework.r2dbc.core.DefaultDatabaseClient$DefaultGenericExecuteSpec");
    }

    @Override
    public ElementMatcher.Junction methodMatcher(TypeDescription typeDescription) {
        return named("execute");
    }

    @Override
    public String getPluginClassName() {
        return "rabbit.flt.plugins.spring.r2dbc.plugin.ExecuteSpecSupportPlugin";
    }
}
